import {
	request,
} from '@/api/request';
const apiList = [{
		// /api/index/initData
		name: 'initData',
		method: 'GET',
		url: '/api/index/initData',
	},
	{
		// /api/index/getGlobalInfo
		name: 'getGlobalInfo',
		method: 'GET',
		url: '/api/index/getGlobalInfo',
	},
	// /api/index/ok
	{
		name: 'ok',
		url: '/api/index/ok',
	},
	// /api/index/comment
	{
		name: 'comment',
		url: '/api/index/comment',
	},
	// /api/index/createGlobal
	{
		name: 'createGlobal',
		url: '/api/index/createGlobal',
	},
]

module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data) => request({
		url: params.url,
		method: params.method || 'POST',
		data
	})
	return mode
}, {})